package model.impl;

import model.IMainModel;
import model.bean.DisplayData;
import model.bean.RawData;

/**
 * Created by 10153 on 2018/7/16.
 */

public class MainModelImpl implements IMainModel{
    
    //实现对传入字节流数据的解析，组装成RawData
    @Override
    public RawData analyzeData(byte[] bytes, int length) {
        RawData data = new RawData();
        data.testString = new String(bytes, 0, length);//test used
        return data;
    }
    
    //实现对心率计算算法和行为分析算法的调用，并将结果进行组装 耗时方法
    @Override
    public DisplayData handleRawData(RawData data) {
        DisplayData displayData = new DisplayData();
        displayData.setState(data.testString);//test used
        return displayData;
    }
    
    //从数据库返回最新的本地数据
    @Override
    public String getDataFromLocal() {
        return null;
    }
    
    //将bean存入数据库
    @Override
    public void saveData(RawData data) {
    
    }
    
    @Override
    public void saveData(DisplayData data) {
    
    }
}
